﻿using System;

namespace HealthCommunity
{
	public partial class DocumentViewer : System.Web.UI.Page
	{
		public string StorageKey
		{
			get
			{
				return CommonHelper.QueryString("key");
			}
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
			{
				if (!string.IsNullOrEmpty(StorageKey))
				{
					try
					{
						this.PdfViewer1.StorageKey = StorageKey;
					}
					catch (Exception exc)
					{
						PdfViewer1.Visible = false;
						PdfViewerToolbar1.Visible = false;

						ltrMsg.Text = exc.Message;
					}
				}
				else
				{
					PdfViewer1.Visible = false;
					PdfViewerToolbar1.Visible = false;

					ltrMsg.Text = "无法加载文档";
				}
			}
		}
	}
}